﻿package mortal.game.view.forging.util
{
    import Message.DB.Tables.*;
    import __AS3__.vec.*;
    import flash.utils.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.view.common.util.*;
    import mortal.game.view.forging.data.*;
    import mortal.game.view.shop.*;
    import mortal.game.view.shopMall.data.*;

    public class StrengUtil extends Object
    {

        public function StrengUtil()
        {
            return;
        }// end function

        public static function showBuyTipWin(param1:int, param2:int) : void
        {
            var _loc_3:* = new ItemData(410021000);
            var _loc_4:* = ShopConfig.instance.getFastBuyItemByCode(_loc_3.itemInfo.bind ? (_loc_3.itemInfo.codeUnbind) : (_loc_3.itemInfo.code));
            BuyItemWin.instance.showWin(_loc_4);
            BuyItemWin.instance.setDefaultBuyNum(param2);
            return;
        }// end function

        public static function getEquipHotAttrType(param1:int) : int
        {
            var _loc_2:* = GameDefConfig.instance.getEquipName(param1);
            var _loc_3:* = EquipJewelMatchConfig.instance.getInfoByType(param1, "refresh");
            if (_loc_3)
            {
                return _loc_3.jeweltype;
            }
            return 0;
        }// end function

        public static function getRefreshCombat(param1:ItemData) : int
        {
            var _loc_3:int = 0;
            var _loc_5:String = null;
            var _loc_6:AttributeData = null;
            var _loc_7:Number = NaN;
            var _loc_2:* = EquipmentUtil.getEquipmentXiLianAttrs(param1);
            var _loc_4:* = new Dictionary();
            for each (_loc_5 in EquipmentUtil.equipBaseAttrList)
            {
                
                _loc_4[_loc_5] = 0;
            }
            for each (_loc_6 in _loc_2)
            {
                
                _loc_5 = GameDefConfig.instance.getItem("FightRoleAttribute", _loc_6.type).text;
                _loc_5 = EquipmentUtil.transFightRoleAttr(_loc_5);
                _loc_3 = _loc_6.value;
                _loc_4[_loc_5] = _loc_4[_loc_5] + _loc_3;
            }
            _loc_7 = 0;
            for (_loc_5 in _loc_4)
            {
                
                _loc_7 = _loc_7 + CombatUtil.getCombatValueByName(_loc_5, _loc_4[_loc_5]);
            }
            return _loc_7;
        }// end function

        public static function isStrengStone(param1:int) : Boolean
        {
            if (param1 == ForgingConst.StrengStoneCode || param1 == ForgingConst.StrengStoneCodeUnbind)
            {
                return true;
            }
            return false;
        }// end function

    }
}
